import Vue from 'vue';
import App from './App';
// 弹出框
import DialogBox from './components/DialogBox/DialogBox';

Vue.config.productionTip = false
// 全局组件
Vue.component('DialogBox', DialogBox);
//mescroll
import MescrollBody from "@/components/mescroll-uni/mescroll-body.vue"
import MescrollUni from "@/components/mescroll-uni/mescroll-uni.vue"
import request from "./http.js";
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
Vue.use(ElementUI)
import { vueBaberrage } from 'vue-baberrage'
Vue.use(vueBaberrage);
Vue.component('mescroll-body', MescrollBody)
Vue.component('mescroll-uni', MescrollUni)
Vue.prototype.$http = request;
App.mpType = 'app'

const app = new Vue({
	...App
})
app.$mount()
let token = uni.getStorageSync('token').token ? true : false;

if(!token) {
	uni.request({
		url: "http://www.esadmin.com/api/login",
		success(res) {
			uni.setStorageSync('token', res.data.data.token)
		}
	})
}

